﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Omega.Editor.Classes
{
    static public class AreaDeTrabalho
    {
        static public Syncfusion.Windows.Forms.Tools.DockingManager DockingManager;
        static public Forms.FrmEditor FrmEditor;
      //  static public Controls.DirectXRenderer Render;
        
        
        static public class UniqueName
        {
            public const String OpenGlWindow = "Scene Render";
            public const String CntrlOutPut = "Output";

        }

      
        static void Initialize()
        {
            if (Editor.Controls.RenderScreen == null)
            {
                Editor.Controls.RenderScreen = new Omega.SceneControl();
                Editor.Controls.RenderScreen.Dock = System.Windows.Forms.DockStyle.Fill;
               // Omega.Game.Framework.Graphics.CreateNewRender(Editor.Controls.RenderScreen.Handle);
            }
        }

        static public IntPtr Inicia(Omega.Editor.Forms.FrmEditor form)
        {
            Initialize();
            FrmEditor = form;
            DockingManager = form.DockingManager;

            return Editor.Controls.RenderScreen.Handle;
        }

        static public bool DockControl(String UniqueName)
        {
            switch (UniqueName)
            {
                case AreaDeTrabalho.UniqueName.OpenGlWindow:
                    {
                        DockingManager.SetDockLabel(Editor.Controls.RenderScreen , "Scene Render");
                        DockingManager.SetEnableDocking(Editor.Controls.RenderScreen, false);
                        DockingManager.SetEnableDocking(Editor.Controls.RenderScreen, true);
                        DockingManager.DockControl(Editor.Controls.RenderScreen, FrmEditor, 
                            Syncfusion.Windows.Forms.Tools.DockingStyle.None, 500);
                       
                        
                        return true;
                    }
                case AreaDeTrabalho.UniqueName.CntrlOutPut:
                    {
                        if (Editor.Controls.OutPut == null)
                            Editor.Controls.OutPut = new 
                                Omega.Editor.Controls.CntrlTelaOutPut();

                        DockingManager.SetDockLabel(Editor.Controls.OutPut, "Output");
                        DockingManager.SetEnableDocking(Editor.Controls.OutPut, false);
                        DockingManager.SetEnableDocking(Editor.Controls.OutPut, true);
                        DockingManager.DockControl(Editor.Controls.OutPut,
                            FrmEditor, Syncfusion.Windows.Forms.Tools.DockingStyle.Bottom,
                            100);
                        return true;
                    }
            }
            return false;
        }


    }
}
